import React, { Component } from 'react'
import { NavLink } from 'react-router-dom'
import { Icon } from 'react-vant';

export default class Footer extends Component {
    static defaultProps = {
        footerList: [
            {
                name: '美洽',
                path: '/main/home',
                icon: 'apps-o'
            },
            {
                name: '商城',
                path: '/main/shop',
                icon: 'shop-collect-o'
            },
            {
                name: '科普',
                path: '/main/scope',
                icon: 'label-o'
            },
            {
                name: '我的',
                path: '/main/my',
                icon: 'user-o'
            },
        ]
    }
    render() {
        const { footerList } = this.props
        return (
            <div className='footer'>
                {
                    footerList.length && footerList.map((item, index) => {
                        return <NavLink key={index} to={item.path} className='flex' >
                            <Icon name={item.icon} size="20" />
                            {item.name}</NavLink>
                    })
                }
            </div>
        )
    }
}


